# @author zfd
# @date 2022年12月14日 14:10
# @desc 定义不同乐器，乐手不同乐器则演奏不同

class Instrument():
    def make_sound(self):
        print("make_sound")


class Erhu(Instrument):
    def make_sound(self):
        print("erhu make_sound")


class Piano(Instrument):
    def make_sound(self):
        print("piano make_sound")


class Violin(Instrument):
    def make_sound(self):
        print("violin make_sound")


class Musician:
    def make_sound(self, instrument):
        instrument.make_sound()


if __name__ == '__main__':
    musician = Musician()
    erhu = Erhu()
    piano = Piano()
    violin = Violin()
    musician.make_sound(erhu)
    musician.make_sound(piano)
    musician.make_sound(violin)
